<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>constant-width-to-height-ratio</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .constant-width-to-height-ratio {
            width: 50%;
            background: linear-gradient(135deg, #4848e7 10%,#0e022e 90%);
        }
        .constant-width-to-height-ratio::before {
            content:"";
            padding-top: 100%;
            float: left;
        }
        .constant-width-to-height-ratio::after {
            content:"";
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
    <div class="constant-width-to-height-ratio"></div>
</body>
</html>